<template>
  <div>
    <div class="header-btn">
      <div>查看文件</div>
      <div>
        <el-button type="info" plain @click="back">返回
        </el-button>
      </div>
    </div>
    <div class="wrap g-card" style="margin-bottom: 20px">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="文件名"> {{ fileInfo.fileName }}</el-form-item>
        <el-form-item label="个人分组"> {{ fileInfo.groupName }}</el-form-item>
        <el-form-item label="摘要">
          <el-input
            disabled
            style="width: 400px"
            type="textarea"
            :rows="2"
            placeholder="请输入内容"
            v-model="fileInfo.text"
          >
          </el-input>
        </el-form-item>
        <el-form-item label="企业分组"> {{ fileInfo.groupName }}</el-form-item>
        <el-form-item label="标签">
            <tag-group v-model="fileInfo.weGroupTagVOS" disabled />
          <!-- <el-tag :key="index" v-for="(tag, index) in dynamicTags">
            {{ tag }}
          </el-tag> -->
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  name: 'LookFile',
  data() {
    return {
      form: {
        region: '',
        textarea: '123'
      },
      fileInfo: {},
      dynamicTags: [] //标签
    }
  },
  created() {
    console.log(this.$route.query)
    this.fileInfo = this.$route.query.fileInfo
    this.dynamicTags = this.$route.query.fileInfo?.label?.split(';')
  },
  mounted() {
  },
  methods: {
    back() {
      if(+this.$route.query.is_person === 99){
        this.$router.back(-1)
      }else{
        this.$router.push({ name: 'FileManagement', query: { is_person: this.$route.query.is_person } })
      }

    }
  },
  components: {}
}
</script>

<style lang="scss" scoped>
@import "../../../../styles/base.scss";

.header-btn {
  @include headerBtn;
}

.wrap {
  @include titleWrap;
  padding-top: 16px;
  padding-left: 20px;
}
</style>
